home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Apple Macintosh Developer Technical Support
- **
- ** File: Start.c
- ** Written by: Eric Soldan
- **
- ** Copyright © 1989-1993 Apple Computer, Inc.
- ** All rights reserved.
- */
-
- /* You may incorporate this sample code into your applications without
- ** restriction, though the sample code has been provided "AS IS" and the
- ** responsibility for its operation is 100% yours. However, what you are
- ** not permitted to do is to redistribute the source as "DSC Sample Code"
- ** after having made changes. If you're going to re-distribute the source,
- ** we require that you make it clear in the source that the code was
- ** descended from Apple Sample Code, but that you've made changes. */
-
-
-
- /*****************************************************************************/
-
-
-
- #include "App.h" /* Get the application includes/typedefs, etc. */
- #include "App.protos.h" /* Get the prototypes for application. */
-
- #ifndef __TEXTSERVICES__
- #include <TextServices.h>
- #endif
-
- #ifndef __TOOLUTILS__
- #include <ToolUtils.h>
- #endif
-
-
-
- /*****************************************************************************/
-
-
-
- extern void _DataInit();
-
- short gQuickBalloons = (shiftKey | controlKey);
-
-
-
- /*****************************************************************************/
- /*****************************************************************************/
-
-
-
- #pragma segment Main
- void main(void)
- {
- NamesTableEntry appNTE;
- EntityName appEntityName;
- OSErr atErr;
-
- #ifdef applec
- UnloadSeg((Ptr)_DataInit); /* Note that _DataInit can't be in Main! */
- #endif
-
- SetApplLimit(GetApplLimit() - 16384);
- /* This decreases the application heap by 16k, which in turn
- ** increases the stack by 16k. */
-
- MaxApplZone(); /* Expand the heap so code segments load at the top. */
-
- Initialize(32, kMinHeap, kMinSpace, nil, nil); /* Initialize the program. */
- DoSetResCursor(watchCursor); /* Rest of startup may take a while. */
- InitRequiredAppleEvents();
- InitConnectAppleEvents();
- InitCustomAppleEvents();
- InitWFMTAppleEvents();
- GetWindowFormats(); /* Get the window definition resource information. */
- OpenRuntimeOnlyAutoNewWindows();
- DoOpenApplication();
- DoAdjustMenus();
- StartDocuments(); /* Open (or print) designated documents for 6.0. */
-
- if(CTEUseTSMTE())
- InitTSMAwareApplication();
-
- UnloadSeg((Ptr)Initialize); /* Initialize can't be in Main! */
-
- atErr = AddPPCNBPAlias(&appNTE, "\pDTS.Chat", &appEntityName);
- EventLoop();
- if (!atErr) RemoveNBPAlias(&appEntityName);
-
- if(CTEUseTSMTE())
- CloseTSMAwareApplication();
-
- ExitToShell(); /* Quit the application. */
- }
-
-
-
-